package com.yf.cmw.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.yf.cmw.presenter.MainPresenter;
import com.yf.cmw.service.TaskService;

/**
 * 开机启动接收通知
 */
public class BootReceiver extends BroadcastReceiver {
    static final String TAG = "BootReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        String msg = "BootReceiver.onReceive is start...";
        Log.e(TAG,msg);
        MainPresenter.writeLogRecord(msg);
        //mainPresenter.test();
        Intent taskService = new Intent(context, TaskService.class);
        context.startService(taskService);
        msg = "BootReceiver.onReceive is end...";
        Log.e(TAG,msg);
        MainPresenter.writeLogRecord(msg);
    }


}

